#ifndef PERSON_H
#define PERSON_H

#include <QObject>

class Person : public QObject
{
    Q_OBJECT
public:
    explicit Person(QObject *parent = nullptr);
    virtual ~Person();
    Person(const Person & a) : QObject (nullptr)
    {
        this->Id = a.Id;
        this->Name = a.Name;
        this->Sex = a.Sex;
        this->Phone = a.Phone;
        this->Email = a.Email;
        this->Major = a.Major;
        this->Time = a.Time;
        this->Pwd = a.Pwd;
    }
    Person& operator= (const Person& a)
    {
        this->Id = a.Id;
        this->Name = a.Name;
        this->Sex = a.Sex;
        this->Phone = a.Phone;
        this->Email = a.Email;
        this->Major = a.Major;
        this->Time = a.Time;
        this->Pwd = a.Pwd;
        return *this;
    }

    Q_PROPERTY(int id READ getId)
    Q_PROPERTY(QString name READ getName)
    Q_PROPERTY(QString sex READ getSex)
    Q_PROPERTY(QString phone READ getPhone)
    Q_PROPERTY(QString email READ getEmail)
    Q_PROPERTY(QString major READ getMajor)
    Q_PROPERTY(QString time READ getTime)
    Q_PROPERTY(QString pwd READ getPwd)

    int getId();
    QString getName();
    QString getSex();
    QString getPhone();
    QString getEmail();
    QString getMajor();
    QString getTime();
    QString getPwd();

public:
    //id
    int                                 Id{-1};
    //姓名
    QString                             Name;
    //性别
    QString                             Sex;
    //phone
    QString                             Phone;
    //邮箱
    QString                             Email;
    //专业班级
    QString                             Major;
    //入学时间
    QString                             Time;
    //密码
    QString                             Pwd;
};

#endif // PERSON_H
